﻿@model List<CompanyManagementDLL.MetaData.RoleMetaData>

@{
    ViewBag.Title = "Role";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<div class="row">
    <div class="col-xs-12">
        <div class="box">
            <div class="box-header">
                <h3 class="box-title">Role Management</h3>
            </div>
            <div class="box-body table-responsive">
                @if (TempData["HasUser"] != null)
                {
                    <div class="alert alert-danger alert-dismissable">
                        <i class="fa fa-ban"></i>
                        <button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button>
                        <b>Alert!</b> @Html.Raw(TempData["HasUser"])
                    </div>
                }
                <div style="margin-bottom: 2%">
                    <a href="@Url.Action("Create", "Role")" class="btn btn-success"><i class="fa fa-plus"></i>Add Role</a>
                </div>
                <table class="table table-bordered table-striped dataTable">
                    <thead>
                        <tr>
                            <th width="80%">Role Name</th>
                            <th width="20%">Action</th>
                        </tr>
                    </thead>
                    <tbody>
                        @if (Model.Count > 0 && Model != null)
                        {
                            foreach (var item in Model)
                            {
                            <tr>
                                <td>@item.RoleName</td>
                                <td>
                                    <a href="~/Role/Edit?Id=@item.RoleId"><i class="fa fa-edit"></i>Edit </a>| 
                                <a href="@Url.Action("Delete", "Role", new { id = item.RoleId })" onclick="return confirm('Are sure want to Delete?')"><i class="fa fa-trash"></i>Delete </a>
                                </td>
                            </tr>
                            }
                        }
                    </tbody>
                </table>

            </div>
        </div>
    </div>
</div>

<script>
    $("#pagetitle").html("Role");
</script>
